package com.hwj.service.Impl;

import com.hwj.entity.Comment;
import com.hwj.mapper.CommentMapper;
import com.hwj.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl  implements CommentService {
    @Autowired
    CommentMapper commentMapper;

    @Override
    public List<Comment> selectForUser(Long postId) {
        return commentMapper.selectForUser(postId);
    }

    @Override
    public List<Comment> selectForChildList(Comment comment) {
        return commentMapper.selectForChildList(comment);
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        return commentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Comment record) {
        return commentMapper.insert(record);
    }

    @Override
    public int insertSelective(Comment record) {
        return commentMapper.insertSelective(record);
    }

    @Override
    public Comment selectByPrimaryKey(Long id) {
        return commentMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Comment record) {
        return commentMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Comment record) {
        return commentMapper.updateByPrimaryKey(record);
    }

    @Override
    public Long selectCount(Long postId) {
        return commentMapper.selectCount(postId);
    }
}
